package com.market.web.model;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.market.domain.FeedBack;
import com.market.domain.Location;
@Component("feedBackModel")
@Scope("session")
public class FeedBackModel extends GenericModel<FeedBack> {

	@Override
	public FeedBack getNewObject() {
		FeedBack feedBack = new FeedBack();
		feedBack.setIsNew(true);
		return feedBack;
			
	}
	
	public List<SelectItem> getAvailableTypes(){
		List<SelectItem> types = new ArrayList<SelectItem>();
		for(FeedBack.TYPE type:FeedBack.TYPE.values()){
			types.add(new SelectItem(type, type.getLabel()));
		}
		return types;
	}

}
